package cn.iocoder.yudao.boot.common.constant;

import cn.iocoder.yudao.boot.common.exception.ErrorCode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.http.HttpStatus;

@Getter
@AllArgsConstructor
public enum ParameterErrorCode implements ErrorCode {
    // 缺少必要参数的二级错误码
    MISSING_REQUIRED_PARAMETER(HttpStatus.BAD_REQUEST, "MissingRequiredParameter", "缺少必要参数", BaseErrorCode.PARAMETER_ERROR),
    // 参数格式错误的二级错误码
    PARAMETER_FORMAT_ERROR(HttpStatus.BAD_REQUEST, "ParameterFormatError", "参数格式错误", BaseErrorCode.PARAMETER_ERROR),
    // 参数超出范围的二级错误码
    PARAMETER_OUT_OF_RANGE(HttpStatus.BAD_REQUEST, "ParameterOutOfRange", "参数超出范围", BaseErrorCode.PARAMETER_ERROR),
    // 参数类型不匹配的二级错误码
    PARAMETER_TYPE_MISMATCH(HttpStatus.BAD_REQUEST, "ParameterTypeMismatch", "参数类型不匹配", BaseErrorCode.PARAMETER_ERROR)
    ;

    private HttpStatus httpStatus;
    private final String code;
    private final String msg;
    private final ErrorCode parent;
}
